\(\int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx\) [226]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 19, antiderivative size = 58 \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\frac {\sqrt {d} \arctan \left (\frac {\sqrt {d \cos (a+b x)}}{\sqrt {d}}\right )}{b}-\frac {\sqrt {d} \text {arctanh}\left (\frac {\sqrt {d \cos (a+b x)}}{\sqrt {d}}\right )}{b} \]

[Out]

arctan((d*cos(b*x+a))^(1/2)/d^(1/2))*d^(1/2)/b-arctanh((d*cos(b*x+a))^(1/2)/d^(1/2))*d^(1/2)/b

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2645, 335, 304, 209, 212} \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\frac {\sqrt {d} \arctan \left (\frac {\sqrt {d \cos (a+b x)}}{\sqrt {d}}\right )}{b}-\frac {\sqrt {d} \text {arctanh}\left (\frac {\sqrt {d \cos (a+b x)}}{\sqrt {d}}\right )}{b} \]

[In]

Int[Sqrt[d*Cos[a + b*x]]*Csc[a + b*x],x]

[Out]

(Sqrt[d]*ArcTan[Sqrt[d*Cos[a + b*x]]/Sqrt[d]])/b - (Sqrt[d]*ArcTanh[Sqrt[d*Cos[a + b*x]]/Sqrt[d]])/b

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 304

Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]}
, Dist[s/(2*b), Int[1/(r + s*x^2), x], x] - Dist[s/(2*b), Int[1/(r - s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !
GtQ[a/b, 0]

Rule 335

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = Denominator[m]}, Dist[k/c, Subst[I
nt[x^(k*(m + 1) - 1)*(a + b*(x^(k*n)/c^n))^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0]
 && FractionQ[m] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 2645

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {\sqrt {x}}{1-\frac {x^2}{d^2}} \, dx,x,d \cos (a+b x)\right )}{b d} \\ & = -\frac {2 \text {Subst}\left (\int \frac {x^2}{1-\frac {x^4}{d^2}} \, dx,x,\sqrt {d \cos (a+b x)}\right )}{b d} \\ & = -\frac {d \text {Subst}\left (\int \frac {1}{d-x^2} \, dx,x,\sqrt {d \cos (a+b x)}\right )}{b}+\frac {d \text {Subst}\left (\int \frac {1}{d+x^2} \, dx,x,\sqrt {d \cos (a+b x)}\right )}{b} \\ & = \frac {\sqrt {d} \arctan \left (\frac {\sqrt {d \cos (a+b x)}}{\sqrt {d}}\right )}{b}-\frac {\sqrt {d} \text {arctanh}\left (\frac {\sqrt {d \cos (a+b x)}}{\sqrt {d}}\right )}{b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.88 \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\frac {\left (\arctan \left (\sqrt {\cos (a+b x)}\right )-\text {arctanh}\left (\sqrt {\cos (a+b x)}\right )\right ) \sqrt {d \cos (a+b x)}}{b \sqrt {\cos (a+b x)}} \]

[In]

Integrate[Sqrt[d*Cos[a + b*x]]*Csc[a + b*x],x]

[Out]

((ArcTan[Sqrt[Cos[a + b*x]]] - ArcTanh[Sqrt[Cos[a + b*x]]])*Sqrt[d*Cos[a + b*x]])/(b*Sqrt[Cos[a + b*x]])

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(181\) vs. \(2(46)=92\).

Time = 0.10 (sec) , antiderivative size = 182, normalized size of antiderivative = 3.14

method result size
default \(-\frac {\sqrt {d}\, \ln \left (\frac {4 d \cos \left (\frac {b x}{2}+\frac {a}{2}\right )+2 \sqrt {d}\, \sqrt {-2 d \left (\sin ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+d}-2 d}{\cos \left (\frac {b x}{2}+\frac {a}{2}\right )-1}\right ) \sqrt {-d}+\sqrt {d}\, \ln \left (-\frac {2 \left (2 d \cos \left (\frac {b x}{2}+\frac {a}{2}\right )-\sqrt {d}\, \sqrt {-2 d \left (\sin ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+d}+d \right )}{\cos \left (\frac {b x}{2}+\frac {a}{2}\right )+1}\right ) \sqrt {-d}+2 d \ln \left (\frac {2 \sqrt {-d}\, \sqrt {-2 d \left (\sin ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )+d}-2 d}{\cos \left (\frac {b x}{2}+\frac {a}{2}\right )}\right )}{2 \sqrt {-d}\, b}\) \(182\)

[In]

int((d*cos(b*x+a))^(1/2)*csc(b*x+a),x,method=_RETURNVERBOSE)

[Out]

-1/2/(-d)^(1/2)*(d^(1/2)*ln(2/(cos(1/2*b*x+1/2*a)-1)*(2*d*cos(1/2*b*x+1/2*a)+d^(1/2)*(-2*d*sin(1/2*b*x+1/2*a)^
2+d)^(1/2)-d))*(-d)^(1/2)+d^(1/2)*ln(-2/(cos(1/2*b*x+1/2*a)+1)*(2*d*cos(1/2*b*x+1/2*a)-d^(1/2)*(-2*d*sin(1/2*b
*x+1/2*a)^2+d)^(1/2)+d))*(-d)^(1/2)+2*d*ln(2/cos(1/2*b*x+1/2*a)*((-d)^(1/2)*(-2*d*sin(1/2*b*x+1/2*a)^2+d)^(1/2
)-d)))/b

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 113 vs. \(2 (46) = 92\).

Time = 0.34 (sec) , antiderivative size = 238, normalized size of antiderivative = 4.10 \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\left [\frac {2 \, \sqrt {-d} \arctan \left (\frac {\sqrt {d \cos \left (b x + a\right )} \sqrt {-d} {\left (\cos \left (b x + a\right ) + 1\right )}}{2 \, d \cos \left (b x + a\right )}\right ) + \sqrt {-d} \log \left (\frac {d \cos \left (b x + a\right )^{2} + 4 \, \sqrt {d \cos \left (b x + a\right )} \sqrt {-d} {\left (\cos \left (b x + a\right ) - 1\right )} - 6 \, d \cos \left (b x + a\right ) + d}{\cos \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1}\right )}{4 \, b}, \frac {2 \, \sqrt {d} \arctan \left (\frac {\sqrt {d \cos \left (b x + a\right )} {\left (\cos \left (b x + a\right ) - 1\right )}}{2 \, \sqrt {d} \cos \left (b x + a\right )}\right ) + \sqrt {d} \log \left (\frac {d \cos \left (b x + a\right )^{2} - 4 \, \sqrt {d \cos \left (b x + a\right )} \sqrt {d} {\left (\cos \left (b x + a\right ) + 1\right )} + 6 \, d \cos \left (b x + a\right ) + d}{\cos \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1}\right )}{4 \, b}\right ] \]

[In]

integrate((d*cos(b*x+a))^(1/2)*csc(b*x+a),x, algorithm="fricas")

[Out]

[1/4*(2*sqrt(-d)*arctan(1/2*sqrt(d*cos(b*x + a))*sqrt(-d)*(cos(b*x + a) + 1)/(d*cos(b*x + a))) + sqrt(-d)*log(
(d*cos(b*x + a)^2 + 4*sqrt(d*cos(b*x + a))*sqrt(-d)*(cos(b*x + a) - 1) - 6*d*cos(b*x + a) + d)/(cos(b*x + a)^2
 + 2*cos(b*x + a) + 1)))/b, 1/4*(2*sqrt(d)*arctan(1/2*sqrt(d*cos(b*x + a))*(cos(b*x + a) - 1)/(sqrt(d)*cos(b*x
 + a))) + sqrt(d)*log((d*cos(b*x + a)^2 - 4*sqrt(d*cos(b*x + a))*sqrt(d)*(cos(b*x + a) + 1) + 6*d*cos(b*x + a)
 + d)/(cos(b*x + a)^2 - 2*cos(b*x + a) + 1)))/b]

Sympy [F]

\[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\int \sqrt {d \cos {\left (a + b x \right )}} \csc {\left (a + b x \right )}\, dx \]

[In]

integrate((d*cos(b*x+a))**(1/2)*csc(b*x+a),x)

[Out]

Integral(sqrt(d*cos(a + b*x))*csc(a + b*x), x)

Maxima [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.16 \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\frac {2 \, d^{\frac {3}{2}} \arctan \left (\frac {\sqrt {d \cos \left (b x + a\right )}}{\sqrt {d}}\right ) + d^{\frac {3}{2}} \log \left (\frac {\sqrt {d \cos \left (b x + a\right )} - \sqrt {d}}{\sqrt {d \cos \left (b x + a\right )} + \sqrt {d}}\right )}{2 \, b d} \]

[In]

integrate((d*cos(b*x+a))^(1/2)*csc(b*x+a),x, algorithm="maxima")

[Out]

1/2*(2*d^(3/2)*arctan(sqrt(d*cos(b*x + a))/sqrt(d)) + d^(3/2)*log((sqrt(d*cos(b*x + a)) - sqrt(d))/(sqrt(d*cos
(b*x + a)) + sqrt(d))))/(b*d)

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.83 \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\frac {d {\left (\frac {\arctan \left (\frac {\sqrt {d \cos \left (b x + a\right )}}{\sqrt {-d}}\right )}{\sqrt {-d}} + \frac {\arctan \left (\frac {\sqrt {d \cos \left (b x + a\right )}}{\sqrt {d}}\right )}{\sqrt {d}}\right )}}{b} \]

[In]

integrate((d*cos(b*x+a))^(1/2)*csc(b*x+a),x, algorithm="giac")

[Out]

d*(arctan(sqrt(d*cos(b*x + a))/sqrt(-d))/sqrt(-d) + arctan(sqrt(d*cos(b*x + a))/sqrt(d))/sqrt(d))/b

Mupad [F(-1)]

Timed out. \[ \int \sqrt {d \cos (a+b x)} \csc (a+b x) \, dx=\int \frac {\sqrt {d\,\cos \left (a+b\,x\right )}}{\sin \left (a+b\,x\right )} \,d x \]

[In]

int((d*cos(a + b*x))^(1/2)/sin(a + b*x),x)

[Out]

int((d*cos(a + b*x))^(1/2)/sin(a + b*x), x)